<?php
include 'includes.php';


if(isset($_SESSION['user'])) {
    $nick = $_POST['nick'];
    $clase = $_POST['clase'];
    $rol = $_POST['rol'];
    
$pj = R::dispense('pjs');
$pj->nick = $nick;
$pj->clase = $clase;
$pj->rol = $rol;

$user = R::load('usuarios', $_SESSION['user']['id']);

$pj->usuario = $user;

R::store($pj);


    
}



error_reporting(E_ALL);
$host3 = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'pj.php';
header("Location: http://" . $host3 . $uri . "/" . $extra);
die();
?>
